#include "AlignerAccuracy.h"
using namespace std;

int main(int argc, char* argv[]) {

	if (argc != 7) {
		cout << "Usage" << endl
				<< "./AlignerAccuracy referenceFile OutputSamFile ReadSortedSamFile ChromoSortedSamFile EditDistance ErrorThreshold"
				<< endl;
		return 0;
	}
	string refFile =argv[1];
	string outputSamFile=argv[2];
	string readSortedFile=argv[3];
	string chromoSortedFile=argv[4];
	int	editDistance=atoi(argv[5]);
	int	errorThreshold=atoi(argv[6]);

	AlignerAccuracy a;
	a.buildChromoMap(outputSamFile);
	map <string, unsigned int>::iterator iter;

	for (iter=a.chromoMap.begin();iter!=a.chromoMap.end();iter ++){
		cout<<iter->first << " ::" << iter->second <<endl;
	}
	a.findCorrectness(readSortedFile, errorThreshold);
	cout <<"Exactly Mapped :" << a.exactlyMapped << endl << "Not Exactly Mapped :"<< a.exactlyNotMapped << endl;
	//a.findAccuracy(refFile,chromoSortedFile,editDistance);
	cout <<"Correctly Mapped :" << a.correctlyMapped << endl << "Not Correctly Mapped :"<< a.incorrectlyMapped << endl;

	return 0;

}
